let fs = require('fs')
let express = require('express')
let router = require('./router')
let BodyParser=require('body-parser')

let app = express()
// 开放资源
app.use('/node_modules', express.static('./node_modules'))
app.use('/public', express.static('./public'))

// 配置中间件
app.engine('html', require('express-art-template'))
app.use(router)

app.use(BodyParser.urlencoded({ extended: false }))
app.use(BodyParser.json())
//响应处理

app.listen(8080, function () {
    console.log('启动成功...')
})

